package com.jnu.erp.common.exception;

import com.jnu.erp.framework.web.exception.IResultCode;

/**
 * 也无异常
 */
public class BizException extends RuntimeException {
    private static final long serialVersionUID = 1L;

    protected final IResultCode iResultCode;

    public BizException(IResultCode iResultCode) {
        this.iResultCode = iResultCode;
    }

    public BizException(IResultCode iResultCode, Throwable cause) {
        super(iResultCode.getMessage(), cause);
        this.iResultCode = iResultCode;
    }

    public IResultCode getiResultCode() {
        return iResultCode;
    }

    @Override
    public String getMessage() {
        return iResultCode.getMessage();
    }
}
